package org.example.myleet.p807;

import org.example.myleet.Utils.Assert;
import org.example.myleet.Utils.JsonUtils;
import org.example.myleet.Utils.Parser;

public class Main {
    public static void main(String[] args) {
        Solution solution = new Solution();
        Assert.isTrue(35 == solution.maxIncreaseKeepingSkyline(Parser.parse("[[3,0,8,4],[2,4,5,7],[9,2,6,3],[0,3,1,0]]")));
        for (int i = 0; i < 10; ++i) {
            createSample();
        }
    }

    public static void createSample() {
        int n = (int) (Math.random() * 50);
        if (n == 0) n = 1;
        int[][] grid = new int[n][n];
        for (int i = 0; i < n; ++i) {
            for (int j = 0; j < n; ++j) {
                grid[i][j] = (int) (Math.random() * 100);
            }
        }
        Solution solution = new Solution();
        int answer = solution.maxIncreaseKeepingSkyline(grid);
        System.out.println("answer: " + answer);
        System.out.println("grid: " + JsonUtils.toJson(grid));
    }
}
